package com.gxa.eloan.controller;

import com.gxa.eloan.pojo.PageBean;
import com.gxa.eloan.pojo.TxWithdraws;
import com.gxa.eloan.service.TxWithdrawsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

@RequestMapping("/withdrawal")
@RestController
public class TxWithdrawsController {
    @Resource(name = "txWithdrawsService")
    private TxWithdrawsService txWithdrawsService;

    @GetMapping("/record")
    public Map<String,Object> selectAll(@RequestParam("page") int page, @RequestParam("limit") int limit){
        System.out.println("进来了!解析");
        PageBean<TxWithdraws> pageBean = txWithdrawsService.selectByPage(page, limit);
        Map<String,Object> map = new Hashtable<>();
        map.put("data",pageBean.getPageBean());
        map.put("code",0);
        map.put("msg","用户data");
        map.put("count",pageBean.getCount());
        return map;

    }
    @GetMapping("/pending")
    public  Map<String,Object> selectAll2(@RequestParam("page") int page, @RequestParam("limit") int limit){
        System.out.println("这是待审核的记录");
        PageBean<TxWithdraws> pageBean = txWithdrawsService.selectByStatus(page, limit);
        Map<String,Object> jsonmap = new Hashtable<>();
        jsonmap.put("data",pageBean.getPageBean());
        jsonmap.put("code",0);
        jsonmap.put("msg","用户data");
        jsonmap.put("count",pageBean.getCount());
        return jsonmap;
    }



}
